package com.xinqi.modules.chat.chat.group.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.chat.chat.group.dto.req.ChatClassUserGroupCreateDTO;
import com.xinqi.modules.chat.chat.group.dto.rsp.ChatGroupResultDTO;
import com.xinqi.modules.chat.chat.group.factory.RemoteChatFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 聊天模块服务
 *
 * @Author：yyzhen
 * @Package：com.xinqi.modules.chat.chat.group.client
 * @Project：xinqi.modules-cloud-plus
 * @name：RemoteChatClient
 * @Date：2023/3/10 15:30
 * @Filename：RemoteChatClient
 */
@FeignClient(contextId = "remoteChatClient", value = ServiceNameConstants.XQ_CHAT, fallbackFactory = RemoteChatFallbackFactory.class)
public interface RemoteChatClient {

    /**
     * 账号注销（聊天板块变动）
     *
     * @return
     */
    @PostMapping("/inner/chat/accountCancel")
    R<Boolean> accountCancel(@RequestParam(value = "userId") Long userId);

    /**
     * 老师（群主）--创建班级群(群成员集合可为空)
     *
     * @param dto
     * @return
     */
    @PostMapping("/inner/chat/class-create-group")
    R<ChatGroupResultDTO> classCreateGroup(@RequestBody ChatClassUserGroupCreateDTO dto);

    /**
     * 老师（群主）-解散班级群
     *
     * @param classId 班级ID
     * @return
     */
    @PostMapping("/inner/chat/class-disband-group")
    R<Boolean> classDisbandGroup(@RequestParam("classId") Long classId);

    /**
     * 老师（群主）-转让班级群
     *
     * @param classId 班级ID
     * @param userId  转让接收人用户ID
     * @return
     */
    @PostMapping("/inner/chat/class-shift-group")
    R<Boolean> classShiftGroup(@RequestParam("classId") Long classId, @RequestParam("userId") Long userId);

    /**
     * 退出班级群
     *
     * @param classId 班级ID
     * @param userId  退出班级群用户ID
     * @return
     */
    @PostMapping("/inner/chat/class-exit-group")
    R<Boolean> classExitGroup(@RequestParam("classId") Long classId, @RequestParam("userId") Long userId);

    /**
     * 加入班级群
     *
     * @param classId 班级ID
     * @param userId  加入班级群用户ID
     * @return
     */
    @PostMapping("/inner/chat/class-join-group")
    R<Boolean> classJoinGroup(@RequestParam("classId") Long classId, @RequestParam("userId") Long userId);
}
